package com.shushan.exam.bean;

import com.android.net.bean.NetBaseBean;
import com.shushan.base.Constants;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * @ClassName: ExerciseResultBean
 * @Desciption: 考试结果bean
 * @author: yichaohua
 * @date: 2018-04-20
 */
public class ExerciseResultBean extends NetBaseBean {

    public int paper_id;
    public int chineseScore;
    public int mathScore;
    public int englishScore;
    public String first_toy; //如果是做为vip，第一次答题获得奖励的玩具名
    public int reward_time;//本次练习获得的手机使用时间
    public int stars_num;//本次练习增加的学贝数
    public int error_count;//本次练习的错题数
    public String more_practice;//例：再完成31次练习即可获得
    public String toy_name;//玩具名

    @Override
    public void initByJson(JSONObject jsonObject) throws JSONException {
        paper_id = jsonObject.optInt("paper_id", 0);
        chineseScore = jsonObject.optInt(Constants.SUBJECT_CHINESE_ID + "", 0);
        mathScore = jsonObject.optInt(Constants.SUBJECT_MACH_ID + "", 0);
        englishScore = jsonObject.optInt(Constants.SUBJECT_ENGLISH_ID + "", 0);
        first_toy = jsonObject.optString("first_toy","");
        reward_time = jsonObject.optInt("reward_time",0);
        stars_num = jsonObject.optInt("stars_num", 0);
        error_count = jsonObject.optInt("error_count", 0);
        more_practice = jsonObject.optString("more_practice", "");
        toy_name = jsonObject.optString("toy_name", "");
    }

}
